package com.example.seckill.service;

import com.example.seckill.pojo.SeckillOrder;
import com.example.seckill.pojo.SeckillStatus;
import com.github.pagehelper.PageInfo;

import java.util.List;

public interface SeckillOrderService {

    /***
     * SeckillOrder多条件分页查询
     * @param seckillOrder SeckillOrder
     * @param page 当前页
     * @param size 每页显示多少条
     * @return PageInfo<SeckillOrder>
     */
    PageInfo<SeckillOrder> findPage(SeckillOrder seckillOrder, int page, int size);

    /***
     * SeckillOrder分页查询
     * @param page 当前页
     * @param size 每页显示多少条
     * @return PageInfo<SeckillOrder>
     */
    PageInfo<SeckillOrder> findPage(int page, int size);

    /***
     * SeckillOrder多条件搜索方法
     * @param seckillOrder SeckillOrder
     * @return List<SeckillOrder>
     */
    List<SeckillOrder> findList(SeckillOrder seckillOrder);

    /***
     * 删除SeckillOrder
     * @param id ID
     */
    void delete(Long id);

    /***
     * 修改SeckillOrder数据
     * @param seckillOrder SeckillOrder
     */
    void update(SeckillOrder seckillOrder);

    /***
     * 新增SeckillOrder
     * @param seckillOrder SeckillOrder
     */
    void add(SeckillOrder seckillOrder);

    /**
     * 根据ID查询SeckillOrder
     * @param id ID
     * @return SeckillOrder
     */
     SeckillOrder findById(Long id);

    /***
     * 查询所有SeckillOrder
     * @return List<SeckillOrder>
     */
    List<SeckillOrder> findAll();

    /**
     * 下单
     * @param id ID
     * @param time time
     * @param username username
     */
    boolean add(Long id, String time, String username);

    /**
     * 查询状态
     * @param username username
     * @return SeckillStatus
     */
    SeckillStatus queryStatus(String username);
}
